<?php


namespace App\Models\Garbage;
use Illuminate\Database\Eloquent\Model;

class GarbageRetrieveOrder extends Model
{
    protected $table = 'garbage_retrieve_orders';
    protected $fillable = ['no','user_id','price','address','status','start_time','end_time',
        'weight','desc','is_retrieve','name','phone','kind_id'];
    public function user()
    {
        return $this->belongsTo(WeichatUser::class,'user_id','id');
    }
    public function images(){
        return $this->hasMany(GarbageRetrieveOrderPic::class,'order_id')->with('files');
    }
    public function kind(){
        return $this->belongsTo(GarbageRetrieveOrderKind::class,'kind_id');
    }
}